export const KEY = "normalRent";
//保存 租金设置
export function getProRent() {
    var jsonString = sessionStorage.getItem(KEY);
    jsonString = jsonString || '[]';
    return JSON.parse(jsonString);
}

export function setProRent(arr) {
    removeProRent();
    sessionStorage.setItem(KEY,JSON.stringify(arr));
}

export function removeProRent() {
    sessionStorage.removeItem(KEY);
}

//删除相对应的一项
export function deleteProRentItem(key) {
    var arr = getProRent();
    for (var i = arr.length - 1; i >= 0; i--) {
        if (arr[i].id == key) {
            arr.splice(i, 1);
        }
    }
    sessionStorage.setItem(KEY, JSON.stringify(arr));
}